home *** CD-ROM | disk | FTP | other *** search
/ Java Primer Plus / Java Primer Plus (Waite Group Proess)(1996).iso / chapter11 / throwab.java < prev    next >
Text File  |  1995-12-31  |  343b  |  23 lines

  1.  
  2. /* Throwing things */
  3. class baseball extends Throwable {
  4.      int speed;
  5.     }
  6.  
  7.  
  8. class throwab {
  9.  
  10.     public static void main(String args[]) throws baseball {
  11.  
  12.     try {
  13.      throw new baseball();
  14.     } catch (ArithmeticException e) {
  15.         System.out.println("Arithmetic");
  16.         }
  17.      finally { System.out.println("Try is done");
  18.         }
  19.       
  20.  
  21.      }
  22.     }
  23.